﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SistemaComprasVentaYICHAN
{
    public partial class AgregarEmpleadoDLG : Form
    {


        public AgregarEmpleadoDLG()
        {
            InitializeComponent();

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.textBox4.Text != "" && this.textBox1.Text != "" && this.textBox2.Text != "" && this.textBox3.Text != "" && this.comboBox1.Text != "" && this.textBox5.Text != "" && this.textBox6.Text != "" && this.textBox7.Text != "" && this.textBox8.Text != "")
            {
                GestorEmpleado gesemp = GestorEmpleado.ObtenerInstancia();
                gesemp.AgregarEmpleado(this.textBox4.Text, this.textBox1.Text, this.textBox2.Text, this.textBox3.Text, this.comboBox1.Text, this.textBox5.Text, this.textBox6.Text, this.textBox7.Text, this.textBox8.Text);

                if (comboBox1.Text == "Jefe de Marca")
                {
                    GestorProveedor gesProv = GestorProveedor.getInstance;
                    ListaProveedoresDLG listaProv = new ListaProveedoresDLG();
                    listaProv.ShowDialog();
                }
                MessageBox.Show("Los datos se agregaron correctamente");
                this.Close();
            }
            else
                MessageBox.Show("El ingreso de todos los campos es obligatorio");

            Close();
        }
    }

}
